package com.itheima.service;

import com.itheima.cammon.PageInof;
import com.itheima.pojo.Dish;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 王同学
 */
@Transactional(rollbackFor = RuntimeException.class)
//遇到这个异常就进行事务回滚
public interface DishService {
     boolean add(Dish dish);

    //分页查询
    PageInof<Dish> page(String name, Integer page, Integer pageSize, Integer type);

    boolean delete(String id);

    boolean update(Dish dish);

    boolean updatestatus(String ids,int status);

    Dish findById(String id);

    List<Dish> findAll(String categoryId);
}
